export default function reducer(state = {
    GoodsType: [],
    addOK:null,
    changeOK:null,
    delOK:null
 }, action) {
     switch (action.type) {
         case "initAllGoodsType":
             let newGoodsType = action.payload ? action.payload : []
             return {...state, GoodsType:[...newGoodsType],addOK:null,changeOK:null,delOK:null}
     
         case "initAddGoodType":
                 return {...state, addOK:action.payload}
 
 
        //   case "changeOneGoodsType":
        //            return {...state, changeOK:action.payload}
         
          case "initDelGoodType":
                return {...state, delOK:action.payload}
 
         default:
             return state
     }
}